package com.hh.bss.common;

import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;


public class TreeChildren {
	public List<TreeNode> list = new ArrayList<TreeNode>();
	
	public int getSize(){
		return list.size();
	}
	
	public void addChild(TreeNode node){
		list.add(node);
	}
	
	public String toString(){
		String result = "[";
		for(Iterator<TreeNode> it = list.iterator();it.hasNext();){
			result  += ((TreeNode)it.next()).toString();
			result +=",";
		}
		result =result.substring(0,result.length()-1);
		result += "]";
		return result;
	}
	
	public void sortChildren(){
		Collections.sort(list,new TreeNodeIDComparator<TreeNode>());
		
		for(Iterator <TreeNode> it = list.iterator();it.hasNext();){
			it.next().sortChildren();
		}
	}
	
	public static void main(String[] args) {
		List<TreeNode> dataList = new ArrayList<TreeNode>();
		
		HashMap<String, String> nodeList = new HashMap<String,String>();
		
		TreeNode root = null;
		
		for(Iterator<TreeNode> it =dataList.iterator();it.hasNext();){
		//	Map<String,String> dataRecord = it.next()
			
		}
	}

}
